projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
161d2e4
)
Correct map_sysmem() logic in do_mem_mw()
author
Simon Glass
<
[email protected]
>
Thu, 5 Mar 2015 19:25:18 +0000
(12:25 -0700)
committer
Simon Glass
<
[email protected]
>
Fri, 17 Apr 2015 01:27:41 +0000
(19:27 -0600)
This function does not unmap what it maps. Correct it.
Signed-off-by: Simon Glass <
[email protected]
>
Reviewed-by: Bin Meng <
[email protected]
>
common/cmd_mem.c
patch
|
blob
|
history
diff --git
a/common/cmd_mem.c
b/common/cmd_mem.c
index 3f85c1aa85b9cc9cb3d2e397f653895a417b0e6a..1cbf84f98524494a987a00cda128b440f67b166b 100644
(file)
--- a/
common/cmd_mem.c
+++ b/
common/cmd_mem.c
@@
-165,7
+165,7
@@
static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#endif
ulong addr, count;
int size;
- void *buf;
+ void *buf
, *start
;
ulong bytes;
if ((argc < 3) || (argc > 4))
@@
-197,7
+197,8
@@
static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
bytes = size * count;
- buf = map_sysmem(addr, bytes);
+ start = map_sysmem(addr, bytes);
+ buf = start;
while (count-- > 0) {
if (size == 4)
*((u32 *)buf) = (u32)writeval;
@@
-211,7
+212,7
@@
static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
*((u8 *)buf) = (u8)writeval;
buf += size;
}
- unmap_sysmem(
buf
);
+ unmap_sysmem(
start
);
return 0;
}